﻿
@{
    ViewBag.Title = "LawDocumentPageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css{
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Bussiness/css/jquery.step.css" rel="stylesheet" />
    <style>
        .bg-light th {
            font-weight: bolder;
            text-align: center;
        }
    </style>
}
<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a>动火作业</a>
            </li>
            <li class="crumb-trail">施工管理</li>
        </ol>
    </div>
</header>
<section id="content" class="animated fadeIn" ng-cloak ng-controller="ConstructionController" ng-init="SearchModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
     SearchModel={};
     StateList(true);
     BindDepartmentList('Dep_Select');
     GetFireOperateFormPageList(SearchModel,page,1);
    ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg">正在加载</div>
        </div>
    </div>
    <form class="form-horizontal">
        <div class="panel">
            <div class="panel-heading">
                <span class="panel-title">
                    <span class="glyphicons glyphicons-filter"></span>搜索过滤
                </span>
            </div>
            <div class="panel-body fill">
                <div class="row">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">部门</label>
                        <div class="col-lg-2">
                            <select id="Dep_Select" class="selectpicker show-tick form-control" ng-model="SearchModel.DepartmentId" data-live-search="true">
                                <option value="" selected>所有部门</option>
                            </select>
                        </div>
                        <label class="col-sm-1 control-label">厂区</label>
                        <div class="col-lg-2">
                            <select class="form-control" ng-model="SearchModel.FactoryAreaId" data-live-search="true">
                                <option value="" selected>全部</option>
                                <option value="1">浦东</option>
                                <option value="2">大场</option>
                            </select>
                        </div>
                        <label class="col-sm-1 control-label">开始时间</label>
                        <div class="col-sm-2">
                            <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.StartTime"></datepicker>
                        </div>

                        <label class="col-sm-1 control-label">结束时间</label>
                        <div class="col-sm-2">
                            <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.EndTime"></datepicker>
                        </div>


                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">状态</label>
                        <div class="col-sm-2">
                            <select id="" class="form-control" ng-model="SearchModel.Status">
                                <option value="" selected>所有状态</option>
                                <option value="{{x.Id}}" ng-repeat="x in StateList">{{x.StatusName}}</option>
                            </select>
                        </div>
                        <label class="col-sm-1 control-label">单号</label>
                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="SearchModel.FormNo" />
                        </div>
                        <label class="col-sm-1 control-label">施工单号</label>
                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="SearchModel.ConstructionFormNo" />
                        </div>

                        <button class="btn btn-primary" ng-click="GetFireOperateFormPageList(SearchModel,1);">查询</button>
                        <button class="btn btn-primary" ng-click="ClearCondition();GetFireOperateFormPageList(SearchModel,1);">清空查询条件</button>
                    </div>
                </div>

            </div>
        </div>
        <div class="row">
            <div class="col-sm-3">
                <div class="panel panel-tile text-center">
                    <div class="panel-heading hidden">
                        <span class="panel-title"><i class="fa fa-pencil"></i> Title</span>
                    </div>
                    <div class="panel-body bg-info" style="cursor:pointer;" ng-click="ClearCondition(SearchModel);GetFireOperateFormPageList(SearchModel,1);">
                        <h1 class="fs25 mbn">{{TaskCount.Total}}</h1>
                        <h6 class="text-white fs20">全部</h6>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="panel panel-tile text-center">
                    <div class="panel-heading hidden">
                        <span class="panel-title"><i class="fa fa-pencil"></i> Title</span>
                    </div>
                    <div class="panel-body bg-system" style="cursor:pointer;" ng-click="ClearCondition(SearchModel);SearchModel.Status='1';GetFireOperateFormPageList(SearchModel,1);">
                        <h1 class="fs25 mbn">{{TaskCount.Status_1}}</h1>
                        <h6 class="text-white fs20">待审核</h6>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="panel panel-tile text-center">
                    <div class="panel-heading hidden">
                        <span class="panel-title"><i class="fa fa-pencil"></i> Title</span>
                    </div>
                    <div class="panel-body bg-primary" style="cursor:pointer;" ng-click="ClearCondition(SearchModel);SearchModel.Status='2';GetFireOperateFormPageList(SearchModel,1);">
                        <h1 class="fs25 mbn">{{TaskCount.Status_2}}</h1>
                        <h6 class="text-white fs20">待批准</h6>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="panel panel-tile text-center">
                    <div class="panel-heading hidden">
                        <span class="panel-title"><i class="fa fa-pencil"></i> Title</span>
                    </div>
                    <div class="panel-body bg-success" style="cursor:pointer;" ng-click="ClearCondition(SearchModel);SearchModel.Status='3';GetFireOperateFormPageList(SearchModel,1);">
                        <h1 class="fs25 mbn">{{TaskCount.Status_3}}</h1>
                        <h6 class="text-white fs20">已批准</h6>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div id="step"></div>
            </div>
        </div>
        <div class="panel panel-info" style="margin-top:30px;">
            <div class="panel-heading">
                <span class="panel-title">
                    <span class="glyphicons glyphicons-list"></span>动火作业列表 总数：{{result.totalItemCount}}
                </span>
                <div class="widget-menu pull-right mr10">
                    <div class="btn-group" ng-if="User.DepartmentId==20">
                        <a href="#todaylist" data-toggle="modal" ng-click="GetTodayFireOperateList();" class="btn btn-xs btn-info light">
                            <i class="fa fa-list"></i> 今日动火作业
                        </a>
                    </div>
                    <div class="btn-group">
                        <a href="#todaylist" data-toggle="modal" ng-click="GetTodayFireOperateList(User.DepartmentId);" class="btn btn-xs btn-info light">
                            <i class="fa fa-list"></i> 部门归属地施工
                        </a>
                    </div>
                    <div class="btn-group">
                        <a href="FireOperateFormAdd?page={{result.currentPage}}" class="btn btn-xs btn-default light">
                            <i class="fa fa-plus"></i>添加动火作业
                        </a>
                    </div>
                </div>
            </div>
            <div class="panel-body">
                <table class="table table-bordered" style="table-layout: fixed; word-wrap: break-word; ">
                    <thead>
                        <tr class="bg-light">
                            <th style="width:3%;">序号</th>
                            <th style="width:8%;">动火单号</th>
                            <th style="width:11%;">施工单状态</th>
                            <th style="width:5%;">申请部门</th>
                            <th style="width:5%;">申请日期</th>
                            <th style="width:5%;">施工单位</th>
                            <th style="width:5%;">涉及作业</th>
                            <th style="width:10%;">动火期限</th>
                            <th style="width:10%;">动火地点</th>
                            <th style="width:10%;">动火内容</th>
                            <th style="width:5%;">状态</th>
                            <th style="width:5%;">申请人</th>
                            <th style="width:10%;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-show="DataList.length==0 && !DataLoading">
                            <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                        </tr>
                        <tr ng-repeat="x in DataList" ng-click="ShowStep(x.Status);">
                            <td style="text-align:center;">
                                <span>{{((result.currentPage-1)*20)+($index+1)}}</span>
                            </td>
                            <td style="text-align:center;" ng-bind="x.FormNo"></td>
                            <td style="text-align:center;">{{x.ConstructionInfo}}</td>
                            <td style="text-align:center;" ng-bind="x.DepartmentName"></td>
                            <td style="text-align:center;">{{x.ApplyDate|JSONDate:'yyyy-MM-dd'}}</td>
                            <td style="text-align:center;" ng-bind="x.CompanyName"></td>
                            <td style="text-align:center;" ng-bind="x.TypeList + (x.OtherType==null?'':x.OtherType)"></td>

                            <td style="text-align:center;">{{x.StartTime|JSONDate:'yyyy-MM-dd'}}~{{x.EndTime|JSONDate:'yyyy-MM-dd'}}</td>
                            <td style="text-align:center;">{{x.FactoryAreaName}}{{x.FormLocationContent}}</td>
                            <td style="text-align:center;" ng-bind="x.Content"></td>
                            <td style="text-align:center;" ng-bind="x.StatusInfo.StatusName"></td>
                            <td style="text-align:center;" ng-bind="x.CreateUserName"></td>
                            <td style="text-align:center;">
                                <a href="FireOperateFormApprove?Id={{x.Id}}&&page={{result.currentPage}}" ng-if="x.ShowApprove" class="btn btn-primary btn-xs btn-label"><i class="fa fa-check-circle-o"></i> {{x.StatusInfo.OperateName}}</a>
                                <a ng-if="x.Status==0" href="FireOperateFormEdit?Id={{x.Id}}&&page={{result.currentPage}}" class="btn btn-warning btn-xs btn-label"><i class="fa fa-pencil-square-o"></i> 编辑</a>
                                <a href="FireOperateFormDetail?Id={{x.Id}}&&page={{result.currentPage}}" class="btn btn-info btn-xs btn-label"><i class="fa fa-info-circle"></i> 详细</a>
                                <a ng-if="x.Status==0" ng-click="DeleteFireOperateForm(x.Id,SearchModel,result.currentPage);" class="btn btn-danger btn-xs btn-label"><i class="fa fa-trash"></i>  删除</a>
                                <a ng-if="x.Status==1 && x.CreateUser==User.UserNo" ng-click="WithdrawForm(x.Id,2,SearchModel,result.currentPage);" class="btn btn-danger btn-xs btn-label"><i class="fa fa-reply"></i>  撤回</a>
                                <a ng-show="x.ShowTicket" href="FireOperateTicketList?Id={{x.Id}}&&page={{result.currentPage}}" class="btn btn-primary btn-xs btn-label"><i class="fa fa-book"></i> 动火票</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="text-center" ng-show="DataList!=null && DataList.length>0">
            <ul class="pagination  justify-content-center">
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetFireOperateFormPageList(SearchModel,1);">首页</a></li>
                <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetFireOperateFormPageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetFireOperateFormPageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetFireOperateFormPageList(SearchModel,result.totalPage);">尾页</a></li>
            </ul>
        </div>
    </form>
    <div class="modal fade" id="AddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">添加消防队伍人员</h2>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">厂区：</label>
                            <div class="col-lg-3">
                                <select class="form-control" ng-model="AddModel.FactoryArea">
                                    <option value="" selected>请选择厂区</option>
                                    <option ng-repeat="x in FactoryList" value="{{x.Factory}}">{{x.Factory}}</option>
                                </select>
                            </div>
                            <label class="col-lg-2 control-label">职位：</label>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" ng-model="AddModel.Title">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">姓名：</label>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" ng-model="AddModel.Name">
                            </div>
                            <label class="col-lg-2 control-label">电话：</label>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" ng-model="AddModel.Phone">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">工作任务：</label>
                            <div class="col-lg-8">
                                <textarea class="form-control" ng-model="AddModel.WorkTask" rows="5"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">上传资质：</label>
                            <div class="col-lg-8" id="filecontrol">
                                <input type="file" ngf-select name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="false" data-show-upload="false" required>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                    <button type="button" class="btn btn-primary" ng-click="AddFighter(AddModel,1);">提交</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <div class="modal fade" id="todaylist" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">今日动火作业</h2>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <table class="table table-bordered" style="table-layout: fixed; word-wrap: break-word; ">
                            <thead>
                                <tr class="bg-light">
                                    <th style="width:3%;">序号</th>
                                    <th style="width:8%;">动火单号</th>
                                    <th style="width:5%;">申请部门</th>
                                    <th style="width:5%;">施工单位</th>
                                    <th style="width:5%;">涉及作业</th>
                                    <th style="width:10%;">动火期限</th>
                                    <th style="width:10%;">动火地点</th>
                                    <th style="width:10%;">动火内容</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="TodayFireOperateList.length==0">
                                    <td colspan="8" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                </tr>
                                <tr ng-repeat="x in TodayFireOperateList">
                                    <td style="text-align:center;">
                                        <span>{{$index+1}}</span>
                                    </td>
                                    <td style="text-align:center;" ng-bind="x.FormNo"></td>
                                    <td style="text-align:center;" ng-bind="x.DepartmentName"></td>
                                    <td style="text-align:center;" ng-bind="x.CompanyName"></td>
                                    <td style="text-align:center;" ng-bind="x.TypeList + (x.OtherType==null?'':x.OtherType)"></td>
                                    <td style="text-align:center;">{{x.StartTime|JSONDate:'yyyy-MM-dd'}}~{{x.EndTime|JSONDate:'yyyy-MM-dd'}}</td>
                                    <td style="text-align:center;">{{x.FactoryAreaName}}{{x.FormLocationContent}}</td>
                                    <td style="text-align:center;" ng-bind="x.Content"></td>
                                </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->



</section>

@section Js{
    <script src="~/Bussiness/js/libs/jquery.step.min.js"></script>
    <script src="~/bussiness/js/pg/Construction.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/bussiness/js/libs/moment.min.js"></script>
    <script src="~/bussiness/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/bussiness/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/bussiness/js/libs/angularjs-datepicker.js"></script>
    <script src="~/bussiness/js/libs/fileinput.js"></script>
    <script src="~/bussiness/js/libs/zh.js"></script>

    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });
        $(".selectpicker").selectpicker({
            noneSelectedText: "所有发布机构"
        });
    </script>
}


